package com.TestDemo.Test2;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: zjz
 * @Date: 2021/11/12/15:31
 * @Description:
 * @Target:
 */
public class GetFileSize {
    public static void main(String[] args) {
        String path = "E:\\迅雷下载\\N0739\\新建文件夹\\pvz-renan.rar";
        getFileSize1(path);
    }


    public static void getFileSize1(String FilePath) {
        File file = new File(FilePath);
        if (file.exists() && file.isFile()) {
            String fileName = file.getName();
            System.out.println("文件"+fileName+"的大小是："+file.length()/1024);
        }
    }


}
